package com.example.newapplication.Fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.example.newapplication.MyMessage;
import com.example.newapplication.R;
import com.example.newapplication.View.CircleImageView;
import com.example.newapplication.Worklog;


public class MyFragment extends Fragment {

    CircleImageView head;
    ConstraintLayout my_message;
    ImageView workLog;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_my, container, false);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        init();
        workLog.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), Worklog.class);
                startActivity(intent);
            }
        });
        my_message.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), MyMessage.class);
                startActivity(intent);
            }
        });

    }

    private void init() {
        head = getActivity().findViewById(R.id.head_img);
        my_message = getActivity().findViewById(R.id.my_message);
        workLog = getActivity().findViewById(R.id.imageView9);
    }
}